#ifndef TB_PREFIX_CPU_H
#define TB_PREFIX_CPU_H

#include "config.h"

#if defined(__LP64__) || defined(__64BIT__) || defined(_LP64)                  \
    || defined(__x86_64) || defined(__x86_64__) || defined(__amd64)            \
    || defined(__amd64__) || defined(__arm64) || defined(__arm64__)            \
    || defined(__sparc64__) || defined(__PPC64__) || defined(__ppc64__)        \
    || defined(__powerpc64__) || defined(__loongarch64) || defined(_M_X64)     \
    || defined(_M_AMD64) || defined(_M_IA64)                                   \
    || (defined(__WORDSIZE) && (__WORDSIZE == 64))                             \
    || defined(TCC_TARGET_X86_64)
#define TB_CPU_BITSIZE (64)
#define TB_CPU_BITBYTE (8)
#define TB_CPU_BITALIGN (7)
#define TB_CPU_BIT32 (0)
#define TB_CPU_BIT64 (1)
#define TB_CPU_SHIFT (6)
#else
#define TB_CPU_BITSIZE (32)
#define TB_CPU_BITBYTE (4)
#define TB_CPU_BITALIGN (3)
#define TB_CPU_BIT32 (1)
#define TB_CPU_BIT64 (0)
#define TB_CPU_SHIFT (5)
#endif

#endif // !TB_PREFIX_CPU_H
